home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1995 / MacHack 1995.toast / Presentations / Presentations ’88 / Feldt's Object Stuff / SSG include / viewMgr.h < prev    next >
Text File  |  1987-03-24  |  4KB  |  86 lines

  1. /*                              - View Manager™ -                                */
  2. /*                           Small Systems Guild                                */
  3.  
  4. /*                       private library header file                            */
  5. /*                   copyright © 1987 Small Systems Guild                         */
  6. /*                       Lightspeed C compiler 2.01                            */
  7.  
  8. /*    DAF    11/07/86    Created this file from view manager design docs        0.1    */
  9. /*    DAF    01/14/87    modified data structures and added routine defs        0.2    */
  10. /*    DAF    02/03/87    modified data structures and routine definitions    0.3    */
  11. /*    DAF    03/24/87    modified and integrated into Interchange code        0.4    */
  12.  
  13. #include    <extender.h>
  14.  
  15. #define        VIEW_MANAGER        /* header already included indication flag    */
  16.  
  17. #define        TEXT_ITEM        1    /* ASCII text, static, edit, interactive...    */
  18. #define        CHARMAP_ITEM    2    /* character graphic data, low resolution!    */
  19. #define        BITMAP_ITEM        3    /* bit mapped graphic data, picture or icon    */
  20. #define        PICT_ITEM        4    /* object oriented graphic data, PICT format*/
  21. #define        BUTTON_ITEM        10    /* pushbutton or target area for clicking     */
  22. #define        CHECKBOX_ITEM    11    /* checkbox boolean, displays true or false    */
  23. #define        RADIOBOX_ITEM    12    /* radio button boolean, displays true/false*/
  24. #define        SCROLLBAR_ITEM    16    /* scrollbar, displays/sets range of values    */
  25. #define        MENU_ITEM        20    /* selectable item from set of menu options    */
  26. #define        LIST_ITEM        50    /* list of options, list manager on Mac        */
  27.  
  28. typedef    char **        TextHandle; 
  29.  
  30. struct    ItemRecord {
  31.                 long        id;                /* unique item identification #    */
  32.                 long        modDate;        /* date and time last modified    */
  33.                 long        security;        /* item access and protection    */
  34.                 Handle        data;            /* item data structure handle    */
  35.                 long        flags;            /* item function/behavior flags    */
  36.                 Rect        itemRect;        /* item display rect within view*/
  37.                 TextHandle    itemText;        /* item title or reference str    */
  38.                 TextHandle    helpText;        /* item help text & information    */
  39.                 int            type;            /* list, control, text, pict...    */
  40.             };
  41. typedef    struct    ItemRecord        ItemRecord;
  42. typedef    struct    ItemRecord *    ItmRecPtr;
  43. typedef    struct    ItemRecord **    ItmRecHndl;    
  44.  
  45. struct    ViewRecord {
  46.                 long        viewID;            /* unique view identification #    */
  47.                 long        modDate;        /* date and time last modified    */
  48.                 long        security;        /* access and protection flags    */
  49.                 long        domain;            /* info types and categories    */
  50.                 long        context;        /* info subcategories and level    */
  51.                 ItmRecHndl    *item;            /* pointer to item Handle array    */
  52.                 int            itemCount;        /* number of items in item list    */
  53.                 int            display;        /* display type, unit type        */
  54.                 Rect        viewRect;        /* view size in pixel/char units*/
  55.                 int            viewType;        /* menu, form, frame, cine, etc.*/
  56.                 int            viewFrame;        /* Mac window type, else border    */
  57.                 int            defaultItem;    /* view default item# (if any)    */
  58.                 long        viewFlags;        /* view function/behavior flags    */
  59.                 long        parent;            /* previous/backtrack viewID    */
  60.                 WindowPtr    viewWindow;        /* window/route view drawn in    */
  61.                 TextHandle    viewText;        /* view title or reference str    */
  62.                 TextHandle    helpText;        /* view help text & information    */
  63.             };
  64. typedef    struct    ViewRecord        ViewRecord;
  65. typedef    struct    ViewRecord *    VRecPtr;
  66. typedef    struct    ViewRecord **    VRecHndl;
  67.  
  68. OSErr        CrtView();                        /* create view from ViewRecord    */
  69. OSErr        GetView();                        /* get view data from res & crt    */
  70. OSErr        SaveView();                        /* save ViewRecord to res fork    */
  71. OSErr        InitView();                        /* init ViewRec data to defaults*/
  72. OSErr        KillView();                        /* remove view, reclaim memory    */
  73. void        ShowView();                        /* make view visible and update    */
  74. void        HideView();                        /* erase view, make invisible    */
  75. ItmRecHndl    DoView();                        /* handle user events in view    */
  76.  
  77. OSErr        CrtItem();                        /* create item from ItemRecord    */
  78. OSErr        GetItem();                        /* get item data from res & crt    */
  79. OSErr        SaveItem();                        /* save ItemRecord to res fork    */
  80. OSErr        InitItem();                        /* init ItemRec data to defaults*/
  81. OSErr        KillItem();                        /* remove item, reclaim memory    */
  82. void        ShowItem();                        /* make item visible and update    */
  83. void        HideItem();                        /* erase item, make invisible    */
  84. long        DoItem();                        /* handle user events in item    */
  85.  
  86.